package miiteen.customsportal.Api;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import miiteen.core.result.ResultMessage;
import miiteen.core.result.ResultMessageTool;
import miiteen.customsportal.special.beans.SpecialTopic;
import miiteen.customsportal.special.service.SpecialTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/Api/SpecialTopic")
@CrossOrigin
@Api(tags = "兰关专题")
public class SpecialTopicApiController {

    @Autowired
    private SpecialTopicService specialTopicService;

    @GetMapping("/list")
    @ApiOperation("list页面")
    public ResultMessage List(){

        List<SpecialTopic> list=specialTopicService.findListByMap();

        if(list!=null&&list.size()>0){
            return ResultMessageTool.Success("success",list);
        }
        return ResultMessageTool.Error("未找到任何信息！");
    }

}
